package com.dmcloud.order.fegincontroller;

import com.dmcloud.order.entity.DmOrder;
import com.dmcloud.order.fegin.IOrderClient;
import com.dmcloud.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by xiaodao
 * date: 2020/3/31
 */
@RestController
@RequestMapping("/feignOrder")
public class OrderFeignController implements IOrderClient {

    @Autowired
    private OrderService orderService;

    @GetMapping("createOrder/{id}")
    @Override
    public void createOrder(@PathVariable("id") String id) {
        DmOrder dmOrder = new DmOrder();
        dmOrder.setId(id);
        orderService.createOrder(dmOrder);
    }
}
